JSGF.SpriteArc = JSGF.inherit(JSGF.SpriteBase);

JSGF.SpriteArc.prototype.additional = function(width, height) {
	this.type = "JSGF.SpriteArc";
	this.width = width;
	this.height = height;
	this.color = "#000000";
	this.fill = false;
}

JSGF.SpriteArc.prototype.draw = function(context) {
	var centerX = this.x + (this.width / 2);
	var centerY = this.y + (this.height / 2);
	var r = this.height / 2;
	var scaleX = this.width / this.height;
	var scaleY = 1;
	if (this.width < this.height) {
		var r = this.width / 2;
		var scaleX = 1
		var scaleY = this.height / this.width;
	}
	context.save();
	if (this.alpha != 1.0) {
		context.globalAlpha = this.alpha;
	}
	context.scale(scaleX, scaleY);
	context.beginPath();
	if (this.fill == true) {
		context.fillStyle = this.color;
		context.arc(centerX / scaleX, centerY / scaleY, r, 0, Math.PI*2, false);
		context.fill();
	} else {
		context.strokeStyle  = this.color;
		context.arc(centerX / scaleX ,centerY / scaleY, r, 0, Math.PI*2, false);
		context.stroke();
	}
	context.closePath();
	if (this.alpha != 1.0) {
		context.globalAlpha = 1.0;
	}
	context.restore();
}

////////////////////////////////////////
//Public
////////////////////////////////////////

JSGF.SpriteArc.prototype.setColor = function(color) {
	this.color = color;
}

JSGF.SpriteArc.prototype.getColor = function() {
	return this.color;
}

JSGF.SpriteArc.prototype.setFill = function(fill) {
	this.fill = fill;
}

JSGF.SpriteArc.prototype.getFill = function() {
	return this.fill;
}

////////////////////////////////////////
// definition by user
////////////////////////////////////////

